<template>
  <div>
    <el-breadcrumb separator-class="el-icon-arrow-right" class="fonts">
      <el-breadcrumb-item :to="{ path: '/contentmanagement' }">内容管理</el-breadcrumb-item
      >
      <el-breadcrumb-item>添加汽车品牌</el-breadcrumb-item>
    </el-breadcrumb>
    <el-divider></el-divider>
    <br />
    <div class="carright">
      <div>
        <span class="red">*</span>
        <span>汽车品牌名称</span>
      </div>
      <el-input
        v-model="input"
        placeholder="请输入内容"
        class="width20"
        style="margin-top: 30px"
      ></el-input>
      <div class="widthbt">
        <el-button type="primary" @click="addcarbrand">保存</el-button>
        <el-button style="margin-left: 40px" @click="backbtn" >取消</el-button>
      </div>
    </div>
    <br />
  </div>
</template>

<script>
export default {
  data() {
    return {
      input: "",
    };
    
  },
  
  methods:{
    
    addcarbrand(){
      console.log.data,
      this.$axios({
        url:"/carBrand/add",
        method:"post",
        data:{
          "name": this.input
        }
      }).then(res=>{
        // console.log(res)
        if(res.data.code===0){
          // console.log("添加成功");
          this.$message('添加成功');
          this.$router.push('/contentmanagement')
        }
      })
    },


    backbtn(){
      this.$router.push('/contentmanagement')
    }
  }
};
</script>

<style scoped>
.red {
  color: red;
}
.carright {
  margin-left: 200px;
  width: 300px;
}
.widthbt {
  text-align: center;
  margin-top: 40px;
}
.fonts{
  font-size: 20px;

}
</style>